package com.fuyao.cloud.admin.api.feign;

import cn.hutool.core.lang.tree.Tree;
import com.fuyao.cloud.admin.api.entity.SysDept;
import com.fuyao.cloud.common.core.constant.ServiceNameConstants;
import com.fuyao.cloud.common.core.util.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

@FeignClient(contextId = "remoteDeptService", value = ServiceNameConstants.UPMS_SERVICE)
public interface RemoteDeptService {
	@GetMapping("/dept/{id}")
	R<SysDept> getById(@PathVariable("id") Long id);

	/**
	 * 根据部门名称查询部门信息
	 * @param deptName 用户名
	 * @return
	 */
	@GetMapping("/dept/details/{deptName}")
	R<SysDept> dept(@PathVariable("deptName") String deptName);

	/**
	 * 获取所有部门信息
	 * @return 部门列表
	 */
	@GetMapping("/dept/details/deptAll")
	R<List<SysDept>> deptAll();

	/**
	 * 获取部门树
	 * @return 部门树
	 */
	@GetMapping("/dept/tree")
	R<List<Tree<Integer>>> tree();

	/**
	 * 获取部门树
	 * @return 部门树
	 */
	@GetMapping("/dept/listByDeptCode")
	R<List<SysDept>> listByDeptCode(List<String> deptCodeList);
}
